<template>
  <div class="empty">
    <img :src="img" class="refreshImg" />
    <p class="text">{{txt}}</p>
    <button @click="btn" class="refreshBtn">
      <slot></slot>
    </button>
  </div>
</template>

<script>
import imgUrl from "@/assets/custom-empty-image.png";
export default {
  name: "empty",
  data() {
    return {};
  },
  props: {
    img: {
      type: String,
      default: imgUrl,
    },
    txt: {
      type: String,
      default: "数据可能走丢了。。。",
    },
  },
  methods: {
    btn() {
      console.log("ojj", this.$route.params.id);
      this.$emit("refresh");
    },
  },
};
</script>

<style lang="less" scoped>
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  // justify-content: center;
  position: absolute;
  top: 90px;
  right: 0;
  left: 0;
  padding-top: 280px;
  .refreshImg {
    width: 280px;
    width: 260px;
    display: block;
  }
  .refreshBtn {
    width: 280px;
    height: 70px;
    // display: block;
  }
}
</style>
